<!-- head -->
{include file='public/head' /}
<!-- head -->
<!-- left -->
{include file='public/left' /}
<!-- left -->

<div class="content-wrapper">
    <section class="content-header">
        <h1>
            销售管理员
            <small>全部销售管理员</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 销售管理员</a></li>

        </ol>
    </section>

    <section class="content">
        <div class="row">
            <div class="col-sm-12">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title" style="font-size: 14px;">共计{$AdminList->total()}条记录</h3>
                        <div class="box-tools pull-right">
                            {in name='5' value=":session('S_ROLE')"}
                            <button type="button" class="btn btn-sm bg-olive" data-url="{:url('selladmin/Admin/AddAdmin','','')}" onclick="ShowMessage(this)"><span class="fa fa-plus"></span> 添加</button>
                            {/in}
                            <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                            </button>
                            <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
                        </div>
                    </div>
                    <div class="box-body">
                        <div class="table-responsive">
                            <table class="table table-bordered table-striped">
                                <form id='iform' action="{:url('Admin/AdminList')}" method="post">
                                    <div class="input-group">
                                        <input type="text" name="admin_name" value="{$admin_name}" class="form-control" style="width: 25%;" placeholder="请输入账号...">
                                        <input type="text" name="admin_note" value="{$admin_note}" class="form-control" style="width: 25%;" placeholder="请输入名称...">
                                        <input type="text" name="code" value="{$code}" class="form-control" style="width: 25%;" placeholder="请输入唯一编码...">
                                        <select class="form-control select" style="width: 25%;" name="adminid">
                                            <option selected="selected" value="0">所有人员</option>
                                            {volist name='selladmin' id='adminlist'}
                                                {if condition="$adminlist['id'] eq $adminid"}
                                                    <option value="{$adminlist.id}" selected>{$adminlist.admin_note}</option>
                                                    {else/}
                                                    <option value="{$adminlist.id}">{$adminlist.admin_note}</option>
                                                {/if}
                                            {/volist}
                                        </select>
                                        <span class="input-group-btn">
                                            <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
                                            </button>
                                        </span>
                                    </div>
                                </form>
                                <thead>
                                    <tr>
                                        <th>编号</th>
                                        <th>账号</th>
                                        <th>唯一编码</th>
                                        <th>名称</th>
                                        <th>头像</th>
                                        <th>最后登录时间</th>
                                        <th>最后登录IP</th>
                                        <th>状态</th>
                                        <!--                                        <th>用户组别</th>-->
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {volist name='AdminList' id='admin'}
                                    <tr>
                                        <td>{$admin.id}</td>
                                        <td>{$admin.admin_name}</td>
                                        <td>{$admin.code}</td>
                                        <td><span style="color: #00a65a">{$admin.admin_note}</span></td>
                                        <td><img src="{:config('adminconfig.ImgPath')}/{$admin.photo}" width="60px;"></td>
                                        <td>{$admin.last_time|date='Y-m-d H:i:s',###}</td>
                                        <td>{$admin.login_ip}</td>
                                        <td>
                                            {if condition="$admin.status eq 1"}<span class="fa fa-toggle-on"></span>
                                            {else/}<span class="fa fa-toggle-off"></span>
                                            {/if}
                                        </td>
                                        <!--                                        <td>{$admin.login_ip}</td>-->
                                        <td style="width: 200px; text-align:right;">
                                            {in name='7' value=":session('S_ROLE')"}
                                            {if condition="$admin.status eq 1"}
                                            <button type="button" class="btn btn-sm bg-olive" data-url="{:url('selladmin/Admin/AdminStatus',['id'=>$admin.id,'status'=>2],'')}" onclick="ShowMessage(this)">锁定 </button>
                                            {else/}
                                            <button type="button" class="btn btn-sm bg-olive" data-url="{:url('selladmin/Admin/AdminStatus',['id'=>$admin.id,'status'=>1],'')}" onclick="ShowMessage(this)">启用 </button>
                                            {/if}
                                            {/in}
                                            {in name='6' value=":session('S_ROLE')"}
                                            <button type="button" class="btn btn-sm bg-olive" data-url="{:url('selladmin/Admin/AdminEdit',['id'=>$admin.id],'')}" onclick="ShowMessage(this)">修改 </button>
                                            {/in}
                                            {in name='8' value=":session('S_ROLE')"}
                                            <button type="button" class="btn btn-sm bg-orange" data-url="{:url('selladmin/Admin/role',['id'=>$admin.id],'')}" onclick="ShowMessage(this)">权限管理 </button>
                                            {/in}
                                        </td>
                                    </tr>
                                    {/volist}
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="box-footer clearfix" style="text-align: center">
                        {$AdminList->render()}
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
<script type="text/javascript">
    function ShowMessage(obj) {
        var url = $(obj).data('url');
        window.location.href = url;
    }
</script>
<!-- foot -->
{include file='public/foot' /}
<!-- foot -->